import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import operate from '@dfeidao/atom-nodejs/db/operate';
import query from '@dfeidao/atom-nodejs/db/query';
import { systemid, productid } from '../../atom/config';
interface Message {
	plan_list_no: string,
	plan_list_name: string,
	plan_type_no: string,
	plan_type_name: string,
	plan_cla_attr_no: string,
	plan_cla_attr_name: string,
	plan_list_depict: string,
	plan_list_status: string,
	// cookie: {
	// 	uk: string;
	// 	[key: string]: string
	// };
	// urls: {
	// 	base: string;
	// 	origin: string;
	// 	url: string;
	// };
	// query: {};
	// params: {};
	// headers: {};
	// captcha: string;
}

interface IWebResult {
	data: unknown;
	cookie?: {
		[name: string]: string;
	} | null;
	content_type?: string;
	headers?: {
		[key: string]: string[];
	};
	attachment?: string;
	redirect?: string;
	status_code?: number;
}

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	log('Service begin path:e:\王举\学习文件\飞道工作文件\测试项目\kh\src\wangju\zj-000005\s002,action_id:' + action_id);

	const { exec, update } = operate(action_id, session_id, systemid);
	update('plan_list', { productid, plan_list_no: message.plan_list_no }, {
		plan_list_name: message.plan_list_name,

		plan_type_name: message.plan_type_name,

		plan_cla_attr_name: message.plan_cla_attr_name,
		plan_list_depict: message.plan_list_depict,


	});
	const dt = await exec();
	log('Service end path:e:\王举\学习文件\飞道工作文件\测试项目\kh\src\wangju\zj-000005\s002,action_id:' + action_id);
	return dt;
}
